package com.xiaoxiao.springbootstudy.controller;

import com.xiaoxiao.springbootstudy.pojo.AfterScale;
import com.xiaoxiao.springbootstudy.pojo.vo.CountResult;
import com.xiaoxiao.springbootstudy.service.AfterScaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class AfterSaleController {

    @Autowired
    private AfterScaleService afterScaleService;

    @PostMapping("/listAfterSale")
    public Map<String, Object> listAfterScale(@RequestBody AfterScale afterScale) {
        return afterScaleService.queryAfterSaleListService(afterScale);
    }

    @GetMapping("/countQuestionType")
    public List<CountResult> countQuestionType() {
        return afterScaleService.countQuestionTypeService();
    }

    @GetMapping("/countState")
    public List<CountResult> countState() {
        return afterScaleService.countStateService();
    }
}
